<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例8</title>
</head>
<body>
    <script>
        let flag = confirm("你喜欢JavaScript吗?");
        if(flag){
            alert("很好，加油");
        }else{
            alert("JavaScript很重要的。");
        }
    </script>
</body>
</html>